<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;


class CreateShopCrowdsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('shop_crowds', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('user_id')->comment('=users.id');
            $table->integer('shop_id')->comment('=shops.id');
            $table->string('phone')->comment('手机号');
            $table->tinyInteger('step')->default(0)->comment('众筹金额等级123');
            $table->decimal('money','8','2')->default(0)->comment('众筹金额');
            $table->integer('is_trust')->default(0)->comment('是否托管1是2否');
            $table->tinyInteger('crowd_type')->default(1)->comment('0:500;1:1300;2:5000');
            $table->tinyInteger('pay_type')->default(1)->comment('1微信2支付宝3银行卡');
            $table->string('out_no')->default('')->comment('外部订单号');
            $table->timestamps();
        });

        DB::statement("ALTER TABLE `shop_crowds` comment '众筹记录表';");

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('shop_crowds');
    }
}
